﻿using HotChocolate;
using HotChocolate.Types;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using GraphQL;

namespace dotnet_graphql_demo.Model
{
    
    public class Owner
    {
        public Owner()
        {
            Accounts = new HashSet<Account>();
        }

        [Key]
        [GraphQLType(typeof(NonNullType<IdType>))]
        public Guid Id { get; set; }
        [Required(ErrorMessage = "Name is required")]
        [GraphQLNonNullType]
        public string Name { get; set; }

        [GraphQLNonNullType]
        public string Address { get; set; }

        public virtual ICollection<Account> Accounts { get; set; }
    }
}
